<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">

<!--互动专区-->
<div class="modal fade" id="modal-message">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">互动专区</h4>
            </div>
            <div class="modal-body">
                <div class="box direct-chat direct-chat-primary">
                    <div class="box-body" id="message-box-body">
                        <div class="direct-chat-messages" id="message-box" style="height: 500px">
                            <div class="direct-chat-msg" th:each="message:${messages}"
                                 th:classappend="${message.sendUserName == session.user.name ? 'right':''}">
                                <div class="direct-chat-info clearfix">
                                    <span class="direct-chat-name"
                                          th:classappend="${message.sendUserName == session.user.name ? 'pull-right':'pull-left'}"
                                          th:text="${message.sendUserName == '管理员' ? '系统通知' : message.sendUserName}">Alexander Pierce</span>
                                    <span class="direct-chat-timestamp"
                                          th:classappend="${message.sendUserName == session.user.name ? 'pull-left':'pull-right'}"
                                          th:text="${#dates.format(message.createTime,'yyyy-MM-dd HH:mm:ss')}"></span>
                                </div>
                                <img class="direct-chat-img"
                                     th:src="${#strings.isEmpty(message.sendUserImage)}?@{/img/avatar.png}:${message.sendUserImage}"
                                     alt="Message User Image">
                                <div class="direct-chat-text" th:utext="${message.content}"></div>
                            </div>
                        </div>
                    </div>
                    <div class="box-footer">
                        <form method="post" id="messageForm">
                            <div class="input-group">
                                <input type="hidden" name="projectId" th:value="${project.id}">
                                <input type="text" name="content" id="message" autocomplete="off"
                                       data-provide="typeahead" placeholder="请输入内容" class="form-control">
                                <span class="input-group-btn">
                                    <button type="button" class="btn btn-primary btn-flat" id="btn-send">发送</button>
                                </span>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--任务进度模态框-->
<div class="modal fade" id="modal-task-process1">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">任务信息</h4>
            </div>
            <div class="modal-body">
                <form id="taskForm-process1" class="form-horizontal">
                    <input type="hidden" name="id">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">计划完成时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="planCompleteTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">开始时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="startTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">完成时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="endTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">铝模板数量（件）</label>
                        <div class="col-sm-8">
                            <input type="number" class="form-control" name="num" placeholder="">
                        </div>
                    </div>
                    <!--<div class="form-group">
                        <label class="col-sm-4 control-label">铝模板重量（吨）</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="weight" placeholder="">
                        </div>
                    </div>-->
                    <div class="form-group">
                        <label class="col-sm-4 control-label">备注</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="remark" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label no-padding-right">状态</label>
                        <div class="col-sm-8">
                            <span class="status-span" style="margin-right: 20px">已完成</span>
                            <button shiro:hasPermission="single:edit:process" type="button" class="btn btn-info btn-start">开始</button>
                            <button shiro:hasPermission="single:edit:process" type="button" class="btn btn-success btn-end">完成</button>
                            <button shiro:hasPermission="single:edit:process" type="button" class="btn btn-danger btn-cancel">撤消</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:edit:process" type="button" class="btn btn-info btn-submit">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modal-task-process2">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">任务信息</h4>
            </div>
            <div class="modal-body">
                <form id="taskForm-process2" class="form-horizontal">
                    <input type="hidden" name="id">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">计划完成时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="planCompleteTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">开始时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="startTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">完成时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="endTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">铝背楞数量（件）</label>
                        <div class="col-sm-8">
                            <input type="number" class="form-control" name="num" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">铝背楞重量（吨）</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="weight" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">备注</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="remark" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label no-padding-right">状态</label>
                        <div class="col-sm-8">
                            <span class="status-span" style="margin-right: 20px">已完成</span>
                            <button shiro:hasPermission="single:edit:process" type="button" class="btn btn-info btn-start">开始</button>
                            <button shiro:hasPermission="single:edit:process" type="button" class="btn btn-success btn-end">完成</button>
                            <button shiro:hasPermission="single:edit:process" type="button" class="btn btn-danger btn-cancel">撤消</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:edit:process" type="button" class="btn btn-info btn-submit">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modal-task-produce">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">任务信息</h4>
            </div>
            <div class="modal-body">
                <form id="taskForm-produce" class="form-horizontal">
                    <input type="hidden" name="id">
                    <input type="hidden" name="completeNum">
                    <input type="hidden" name="completeWeight">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">计划完成时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="planCompleteTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">开始时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="startTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">完成时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="endTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">总数量（件）</label>
                        <div class="col-sm-8">
                            <input type="number" class="form-control" name="num" placeholder="" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">总重量（吨）</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="weight" placeholder="" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">备注</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="remark" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label no-padding-right">状态</label>
                        <div class="col-sm-8">
                            <span class="status-span" style="margin-right: 20px">已完成</span>
                            <button shiro:hasPermission="single:edit:produce" type="button" class="btn btn-info btn-start">开始</button>
                            <button shiro:hasPermission="single:edit:produce" type="button" class="btn btn-success btn-end">完成</button>
                            <button shiro:hasPermission="single:edit:produce" type="button" class="btn btn-danger btn-cancel">撤消</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:edit:produce" type="button" class="btn btn-info btn-submit">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modal-task-consume">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">任务信息</h4>
            </div>
            <div class="modal-body">
                <form id="taskForm-consume" class="form-horizontal">
                    <input type="hidden" name="id">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">计划完成时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="planCompleteTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">开始时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="startTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">完成时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="endTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">总数量（件）</label>
                        <div class="col-sm-8">
                            <input type="number" class="form-control" name="num" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">总重量（吨）</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="weight" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">备注</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="remark" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label no-padding-right">状态</label>
                        <div class="col-sm-8">
                            <span class="status-span" style="margin-right: 20px">已完成</span>
                            <button shiro:hasPermission="single:edit:consume" type="button" class="btn btn-info btn-start">开始</button>
                            <button shiro:hasPermission="single:edit:consume" type="button" class="btn btn-success btn-end">完成</button>
                            <button shiro:hasPermission="single:edit:consume" type="button" class="btn btn-danger btn-cancel">撤消</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:edit:consume" type="button" class="btn btn-info btn-submit">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modal-task-spray">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">任务信息</h4>
            </div>
            <div class="modal-body">
                <form id="taskForm-spray" class="form-horizontal">
                    <input type="hidden" name="id">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">计划完成时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="planCompleteTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">开始时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="startTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">完成时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="endTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">总数量（件）</label>
                        <div class="col-sm-8">
                            <input type="number" class="form-control" name="num" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">总重量（吨）</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="weight" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">备注</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="remark" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label no-padding-right">状态</label>
                        <div class="col-sm-8">
                            <span class="status-span" style="margin-right: 20px">已完成</span>
                            <button shiro:hasPermission="single:edit:spray" type="button" class="btn btn-info btn-start">开始</button>
                            <button shiro:hasPermission="single:edit:spray" type="button" class="btn btn-success btn-end">完成</button>
                            <button shiro:hasPermission="single:edit:spray" type="button" class="btn btn-danger btn-cancel">撤消</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:edit:spray" type="button" class="btn btn-info btn-submit">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modal-task-pack">
    <div class="modal-dialog" style="width:1000px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">任务信息</h4>
            </div>
            <div class="modal-body">
                <form id="taskForm-pack" class="form-horizontal">
                    <input type="hidden" name="id">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">计划完成时间</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control datepicker" name="planCompleteTime" readonly>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">包装开始时间</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control datepicker" name="startTime" readonly>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">包装完成时间</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control datepicker" name="endTime" readonly>
                                </div>
                            </div>
                        </div>
                        <!--<div class="col-md-6">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">主体状态</label>
                            <div class="col-sm-8"  style="margin-left: -20px">
                                <label class="checkbox-inline icheck">
                                    <input type="radio" name="mainStatus" class="minimal-red" value="1" checked >默认
                                </label>
                                <label class="checkbox-inline icheck">
                                    <input type="radio" name="mainStatus" class="minimal-red" value="2" >开始
                                </label>
                                <label class="checkbox-inline icheck">
                                    <input type="radio" name="mainStatus" class="minimal-red" value="3" >完成
                                </label>
                            </div>
                        </div>
                    </div>-->
                        <div id="div-main" class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">主体完成时间</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control datepicker" name="mainCompleteTime" readonly>
                                </div>
                            </div>
                        </div>
                        <!--<div class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">铁件状态</label>
                                <div class="col-sm-8"  style="margin-left: -20px">
                                    <label class="checkbox-inline icheck">
                                        <input type="radio" name="ironStatus" class="minimal-red" value="1" checked >默认
                                    </label>
                                    <label class="checkbox-inline icheck">
                                        <input type="radio" name="ironStatus" class="minimal-red" value="2" >开始
                                    </label>
                                    <label class="checkbox-inline icheck">
                                        <input type="radio" name="ironStatus" class="minimal-red" value="3" >完成
                                    </label>
                                </div>
                            </div>
                        </div>-->
                        <div id="div-iron" class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">铁件完成时间</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control datepicker" name="ironCompleteTime" readonly>
                                </div>
                            </div>
                        </div>
                        <!--<div class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">背楞状态</label>
                                <div class="col-sm-8"  style="margin-left: -20px">
                                    <label class="checkbox-inline icheck">
                                        <input type="radio" name="backStatus" class="minimal-red" value="1" checked >默认
                                    </label>
                                    <label class="checkbox-inline icheck">
                                        <input type="radio" name="backStatus" class="minimal-red" value="2" >开始
                                    </label>
                                    <label class="checkbox-inline icheck">
                                        <input type="radio" name="backStatus" class="minimal-red" value="3" >完成
                                    </label>
                                </div>
                            </div>
                        </div>-->
                        <div id="div-back" class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">背楞完成时间</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control datepicker" name="backCompleteTime" readonly>
                                </div>
                            </div>
                        </div>
                        <!--<div class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">半铝支撑状态</label>
                                <div class="col-sm-8"  style="margin-left: -20px">
                                    <label class="checkbox-inline icheck">
                                        <input type="radio" name="supportStatus" class="minimal-red" value="1" checked >默认
                                    </label>
                                    <label class="checkbox-inline icheck">
                                        <input type="radio" name="supportStatus" class="minimal-red" value="2" >开始
                                    </label>
                                    <label class="checkbox-inline icheck">
                                        <input type="radio" name="supportStatus" class="minimal-red" value="3" >完成
                                    </label>
                                </div>
                            </div>
                        </div>-->
                        <div id="div-support" class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">半铝支撑完成时间</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control datepicker" name="supportCompleteTime" readonly>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12"></div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">总数量（件）</label>
                                <div class="col-sm-8">
                                    <input type="number" class="form-control" name="num" placeholder="">
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">总重量（吨）</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" name="weight" placeholder="">
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">铝支撑数量（件）</label>
                                <div class="col-sm-8">
                                    <input type="number" class="form-control" name="supportNum" placeholder="">
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">铝支撑重量（吨）</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" name="supportWeight" placeholder="">
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">备注</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="remark" placeholder="">
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right">状态</label>
                                <div class="col-sm-10">
                                    <span class="status-span" style="margin-right: 20px">已完成</span>
                                    <button shiro:hasPermission="single:edit:pack" type="button" class="btn btn-info btn-start">开始</button>
                                    <button shiro:hasPermission="single:edit:pack" type="button" class="btn btn-success btn-end">完成</button>
                                    <button shiro:hasPermission="single:edit:pack" type="button" class="btn btn-danger btn-cancel">撤消</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:edit:pack" type="button" class="btn btn-info btn-submit">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modal-task-store">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">任务信息</h4>
            </div>
            <div class="modal-body">
                <form id="taskForm-store" class="form-horizontal">
                    <input type="hidden" name="id">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">开始时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="startTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">完成时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="endTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">首次发货时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="firstShipTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">最后发货时间</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control datepicker" name="lastShipTime" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">备注</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="remark" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-4 control-label no-padding-right">状态</label>
                        <div class="col-sm-8">
                            <span class="status-span" style="margin-right: 20px">已完成</span>
                            <button shiro:hasPermission="single:edit:store" type="button" class="btn btn-info btn-start">开始</button>
                            <button shiro:hasPermission="single:edit:store" type="button" class="btn btn-success btn-end">完成</button>
                            <button shiro:hasPermission="single:edit:store" type="button" class="btn btn-danger btn-cancel">撤消</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:edit:store" type="button" class="btn btn-info btn-submit">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>

<!--文件上传下载模态框-->
<div class="modal fade" id="modal-file-send">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">上传文件</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-offset-1">
                        <form id="fileForm-send" class="form-horizontal">
                            <input type="hidden" name="projectId" th:value="${project.id}">
                            <input type="hidden" name="taskId">
                            <div class="form-group file-div"></div>
                            <div class="form-group">
                                <label>上传文件</label>
                                <input type="file" multiple="multiple" name="file">
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:upload:send" type="button" class="btn btn-info btn-file-upload">上传</button>
                <a shiro:hasPermission="single:download:send" href="#" class="btn btn-success btn-file-download">下载</a>
                <button shiro:hasPermission="single:upload:send" type="button" class="btn btn-danger btn-file-del">删除</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modal-file-process1">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">上传文件</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-offset-1">
                        <form id="fileForm-process1" class="form-horizontal">
                            <input type="hidden" name="projectId" th:value="${project.id}">
                            <input type="hidden" name="taskId">
                            <div class="form-group file-div"></div>
                            <div class="form-group">
                                <label>上传文件</label>
                                <input type="file" multiple="multiple" name="file">
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:upload:process" type="button" class="btn btn-info btn-file-upload">上传</button>
                <a shiro:hasPermission="single:download:process" href="#" class="btn btn-success btn-file-download">下载</a>
                <button shiro:hasPermission="single:upload:process" type="button" class="btn btn-danger btn-file-del">删除</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modal-file-process2">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">上传文件</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-offset-1">
                        <form id="fileForm-process2" class="form-horizontal">
                            <input type="hidden" name="projectId" th:value="${project.id}">
                            <input type="hidden" name="taskId">
                            <div class="form-group file-div"></div>
                            <div class="form-group">
                                <label>上传文件</label>
                                <input type="file" multiple="multiple" name="file">
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:upload:process" type="button" class="btn btn-info btn-file-upload">上传</button>
                <a shiro:hasPermission="single:download:process" href="#" class="btn btn-success btn-file-download">下载</a>
                <button shiro:hasPermission="single:upload:process" type="button" class="btn btn-danger btn-file-del">删除</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modal-file-consume">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">上传文件</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-offset-1">
                        <form id="fileForm-consume" class="form-horizontal">
                            <input type="hidden" name="projectId" th:value="${project.id}">
                            <input type="hidden" name="taskId">
                            <div class="form-group file-div"></div>
                            <div class="form-group">
                                <label>上传文件</label>
                                <input type="file" multiple="multiple" name="file">
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:upload:consume" type="button" class="btn btn-info btn-file-upload">上传</button>
                <a shiro:hasPermission="single:download:consume" href="#" class="btn btn-success btn-file-download">下载</a>
                <button shiro:hasPermission="single:upload:consume" type="button" class="btn btn-danger btn-file-del">删除</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modal-file-spray">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">上传文件</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-offset-1">
                        <form id="fileForm-spray" class="form-horizontal">
                            <input type="hidden" name="projectId" th:value="${project.id}">
                            <input type="hidden" name="taskId">
                            <div class="form-group file-div"></div>
                            <div class="form-group">
                                <label>上传文件</label>
                                <input type="file" multiple="multiple" name="file">
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:upload:spray" type="button" class="btn btn-info btn-file-upload">上传</button>
                <a shiro:hasPermission="single:download:spray" href="#" class="btn btn-success btn-file-download">下载</a>
                <button shiro:hasPermission="single:upload:spray" type="button" class="btn btn-danger btn-file-del">删除</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modal-file-pack">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">上传文件</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-offset-1">
                        <form id="fileForm-pack" class="form-horizontal">
                            <input type="hidden" name="projectId" th:value="${project.id}">
                            <input type="hidden" name="taskId">
                            <div class="form-group file-div"></div>
                            <div class="form-group">
                                <label>上传文件</label>
                                <input type="file" multiple="multiple" name="file">
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:upload:pack" type="button" class="btn btn-info btn-file-upload">上传</button>
                <a shiro:hasPermission="single:download:pack" href="#" class="btn btn-success btn-file-download">下载</a>
                <button shiro:hasPermission="single:upload:pack" type="button" class="btn btn-danger btn-file-del">删除</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modal-file-store">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">上传文件</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-offset-1">
                        <form id="fileForm-store" class="form-horizontal">
                            <input type="hidden" name="projectId" th:value="${project.id}">
                            <input type="hidden" name="taskId">
                            <div class="form-group file-div"></div>
                            <div class="form-group">
                                <label>上传文件</label>
                                <input type="file" multiple="multiple" name="file">
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button shiro:hasPermission="single:upload:store" type="button" class="btn btn-info btn-file-upload">上传</button>
                <a shiro:hasPermission="single:download:store" href="#" class="btn btn-success btn-file-download">下载</a>
                <button shiro:hasPermission="single:upload:store" type="button" class="btn btn-danger btn-file-del">删除</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modal-file-produce">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">上传文件</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-offset-1">
                        <form id="fileForm-produce" class="form-horizontal">
                            <input type="hidden" name="projectId" th:value="${project.id}">
                            <input type="hidden" name="taskId">
                            <div class="form-group file-div"></div>
                            <div class="form-group">
                                <label>上传文件</label>
                                <input type="file" multiple="multiple" name="file">
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button shiro:hasAnyRoles="F1, F2, F3, F4, admin" type="button" class="btn btn-info btn-file-upload">上传</button>
                <a shiro:hasAnyRoles="F1, F2, F3, F4, admin" href="#" class="btn btn-success btn-file-download">下载</a>
                <button shiro:hasAnyRoles="F1, F2, F3, F4, admin" type="button" class="btn btn-danger btn-file-del">删除</button>
            </div>
        </div>
    </div>
</div>

<section class="content-header">
    <button id="focus-btn" th:style="|margin-right: 10px; display: ${(project.focus == 0 && project.status == 2) ? 'inline' : 'none'}|"
            shiro:hasPermission="single:focus" type="button" class="btn btn-success pull-right"
            th:onclick="|updateFocus(${project.id}, 1)|">重点项目
    </button>
    <button id="unFocus-btn" th:style="|margin-right: 10px;display: ${(project.focus == 1 && project.status == 2) ? 'inline' : 'none'}|"
            shiro:hasPermission="single:focus" type="button" class="btn btn-danger pull-right"
            th:onclick="|updateFocus(${project.id}, 0)|">取消重点
    </button>
    <h1 style="margin-bottom: 10px" th:text="${project.name}"></h1>
    <h7>
        <b>订单号：</b>[[${project.orderNum}]]
        <b style="margin-left: 10px">订单类型：</b>[[${project.orderType == 1 ? '体系楼' : project.orderType == 2 ? '备库' : '财务'}]]
        <b style="margin-left: 10px">代码：</b>[[${project.code}]]
        <b style="margin-left: 10px">数量：</b>[[${project.num}]]
        <b style="margin-left: 10px">单件重：</b>[[${project.unitWeight}]]
        <b style="margin-left: 10px">重量：</b>[[${project.weight}]]
        <b style="margin-left: 10px">非标件：</b>[[${project.non}]]
        <b style="margin-left: 10px">面积：</b>[[${project.area}]]
        <b style="margin-left: 10px">喷涂：</b>[[${project.spray}]]
        <b style="margin-left: 10px">拼装：</b>[[${project.assemble == 1 ? '是' : '否'}]]
        <b style="margin-left: 10px">是否有铁件：</b>[[${project.iron == 1 ? '是' : '否'}]]
        <b style="margin-left: 10px">是否半铝支撑：</b>[[${project.halfSupport == 1 ? '是' : '否'}]]
        <b style="margin-left: 10px">铝背楞类型：</b>[[${project.backType == 0 ? '无' : (project.backType == 1 ? '一代' : '二代')}]]
        <b style="margin-left: 10px">客户：</b>[[${project.client}]]
    </h7>
    <br>
    <h7>
        <b>备注：</b>[[${#strings.abbreviate(project.remark,50)}]]
    </h7>
</section>
<section class="content">
    <div class="row">
        <!--下任务-->
        <div class="col-md-3">
            <div class="box box-success box-solid" th:if="${sendTask != null}">
                <div class="box-header with-border">
                    <h3 class="box-title" th:text="${sendTask.alias}">下任务</h3>
                    <small class="pull-right" th:if="${sendTask.docNum != null}" th:text="|已上传：${sendTask.docNum}|"></small>
                </div>
                <div class="box-body single-body">
                    <div>设计文件下发时间：[[${#dates.format(project.designTime,'yyyy-MM-dd')}]]</div>
                    <div>客户要求发货时间：[[${#dates.format(project.shipTime,'yyyy-MM-dd')}]]</div>
                    <div>项目下单时间：[[${#dates.format(project.sendTime,'yyyy-MM-dd')}]]</div>
                    <!--<div>计划发货时间：[[${#dates.format(project.planShipTime,'yyyy-MM-dd')}]]</div>-->
                    <div>计划完成时间：[[${#dates.format(project.planCompleteTime,'yyyy-MM-dd')}]]</div>
                </div>
                <div class="box-footer single-foot">
                    <button style="margin-right: 5px" class="btn btn-success btn-xs pull-right"
                            shiro:hasAnyPermissions="single:upload:send,single:download:send"
                            th:onclick="|openFileModal(${sendTask.id},'send')|">
                        文件
                    </button>
                </div>
            </div>

        </div>
        <!--工艺-->
        <div class="col-md-3">
            <div class="box box-solid" th:if="${processTempTask != null}"
                 th:classappend="${processTempTask.status == 0 ? 'box-danger' : (processTempTask.status == 1 ? 'box-default' : (processTempTask.status == 2 ? 'box-warning' : 'box-success'))}">
                <div class="box-header box- with-border">
                    <h3 class="box-title" th:text="${processTempTask.alias}">工艺</h3>
                    <small class="pull-right" th:if="${processTempTask.docNum != null}" th:text="|已上传：${processTempTask.docNum}|"></small>
                </div>
                <div class="box-body single-body">
                    <div>计划完成时间：[[${#dates.format(processTempTask.planCompleteTime,'yyyy-MM-dd')}]]</div>
                    <div>开始时间：[[${#dates.format(processTempTask.startTime,'yyyy-MM-dd')}]]</div>
                    <div>完成时间：[[${#dates.format(processTempTask.endTime,'yyyy-MM-dd')}]]</div>
                    <div>铝模板数量(件)：[[${processTempTask.num}]]<span style="margin-left: 10px">铝模板重量(吨)：</span>[[${#numbers.formatDecimal(processTempTask.weight,1,2)}]]</div>
                    <div>状态：[[${processTempTask.status == 0 ? '不需要' : (processTempTask.status == 1 ? '未开始' : (processTempTask.status == 2 ? '执行中' : '已完成'))}]]</div>
                    <div>备注：[[${processTempTask.remark}]]</div>
                </div>
                <div class="box-footer single-foot">
                    <button th:if="${project.status == 2 && processTempTask.status != 0}"
                            shiro:hasPermission="single:edit:process"
                            style="margin-right: 5px" class="btn btn-warning btn-xs pull-right"
                            th:onclick="|openEditTaskModal(${processTempTask.id},'process1')|">
                        编辑
                    </button>
                    <button style="margin-right: 5px" class="btn btn-success btn-xs pull-right"
                            shiro:hasAnyPermissions="single:upload:process,single:download:process"
                            th:onclick="|openFileModal(${processTempTask.id},'process1')|">
                        文件
                    </button>
                </div>
            </div>
            <div class="box box-solid" th:if="${processBackTask != null}"
                 th:classappend="${processBackTask.status == 0 ? 'box-danger' : (processBackTask.status == 1 ? 'box-default' : (processBackTask.status == 2 ? 'box-warning' : 'box-success'))}">
                <div class="box-header with-border">
                    <h3 class="box-title" th:text="${processBackTask.alias}">工艺</h3>
                    <small class="pull-right" th:if="${processBackTask.docNum != null}" th:text="|已上传：${processBackTask.docNum}|"></small>
                </div>
                <div class="box-body single-body">
                    <div>计划完成时间：[[${#dates.format(processBackTask.planCompleteTime,'yyyy-MM-dd')}]]</div>
                    <div>开始时间：[[${#dates.format(processBackTask.startTime,'yyyy-MM-dd')}]]</div>
                    <div>完成时间：[[${#dates.format(processBackTask.endTime,'yyyy-MM-dd')}]]</div>
                    <div>铝背楞数量(件)：[[${processBackTask.num}]]<span style="margin-left: 10px">铝背楞重量(吨)：</span>[[${#numbers.formatDecimal(processBackTask.weight,1,2)}]]</div>
                    <!--<div>铝支撑数量：[[${processBackTask.supportNum}]]<span style="margin-left: 10px">铝支撑重量：</span>[[${#numbers.formatDecimal(processBackTask.supportWeight,1,2)}]]</div>-->
                    <div>状态：[[${processBackTask.status == 0 ? '不需要' : (processBackTask.status == 1 ? '未开始' : (processBackTask.status == 2 ? '执行中' : '已完成'))}]]</div>
                    <div>备注：[[${processBackTask.remark}]]</div>
                </div>
                <div class="box-footer single-foot">
                    <button th:if="${project.status == 2 && processBackTask.status != 0}"
                            style="margin-right: 5px" class="btn btn-warning btn-xs pull-right"
                            shiro:hasPermission="single:edit:process"
                            th:onclick="|openEditTaskModal(${processBackTask.id},'process2')|">
                        编辑
                    </button>
                    <button style="margin-right: 5px" class="btn btn-success btn-xs pull-right"
                            shiro:hasAnyPermissions="single:upload:process,single:download:process"
                            th:onclick="|openFileModal(${processBackTask.id},'process2')|">
                        文件
                    </button>
                </div>
            </div>
        </div>
        <!--生产厂-->
        <div class="col-md-3">

            <div class="box box-solid" th:each="task: ${factoryTasks}"
                 th:classappend="${task.status == 0 ? 'box-danger' : (task.status == 1 ? 'box-default' : (task.status == 2 ? 'box-warning' : 'box-success' ))}">
                <div class="box-header with-border">
                    <h3 class="box-title" th:text="${task.alias}"></h3>
                    <small class="pull-right" th:if="${task.docNum != null}"
                           th:text="|已上传：${task.docNum}|"></small>
                </div>
                <div class="box-body single-body">
                    <div>计划完成时间：[[${#dates.format(task.planCompleteTime,'yyyy-MM-dd')}]]</div>
                    <div>开始时间：[[${#dates.format(task.startTime,'yyyy-MM-dd')}]]</div>
                    <div>完成时间：[[${#dates.format(task.endTime,'yyyy-MM-dd')}]]</div>
                    <div>总数量(件)：[[${task.num}]]<span style="margin-left: 10px">总重量(吨)：</span>[[${#numbers.formatDecimal(task.weight,1,2)}]]</div>
                    <div>完成数量(件)：[[${task.completeNum}]]<span style="margin-left: 10px">完成重量(吨)：</span>[[${task.completeWeight!=0?#numbers.formatDecimal(task.completeWeight,1,2):''}]]</div>
                    <div>状态：[[${task.status == 0 ? '不需要' : (task.status == 1 ? '未开始' : (task.status == 2 ? '执行中' : '已完成'))}]] [[${task.reason}]]</div>
                    <div>备注：[[${task.remark}]]</div>
                </div>
                <div class="box-footer single-foot">
                    <button th:if="${project.status == 2 && task.status != 0}"
                            style="margin-right: 5px" class="btn btn-warning btn-xs pull-right"
                            shiro:hasAnyRoles="|${task.factoryCode}, admin|"
                            th:onclick="|openEditTaskModal(${task.id},'produce')|">
                        编辑
                    </button>
                    <button style="margin-right: 5px" class="btn btn-success btn-xs pull-right"
                            shiro:hasAnyRoles="|${task.factoryCode}, admin|"
                            th:onclick="|openFileModal(${task.id},'produce')|">
                        文件
                    </button>
                </div>
            </div>
        </div>
        <!--平库-->
        <div class="col-md-3">
            <div class="box box-solid" th:if="${consumeTask != null}"
                 th:classappend="${consumeTask.status == 0 ? 'box-danger' : (consumeTask.status == 1 ? 'box-default' : (consumeTask.status == 2 ? 'box-warning' : 'box-success'))}">
                <div class="box-header box- with-border">
                    <h3 class="box-title" th:text="${consumeTask.alias}">平库</h3>
                    <small class="pull-right" th:if="${consumeTask.docNum != null}"
                           th:text="|已上传：${consumeTask.docNum}|"></small>
                </div>
                <div class="box-body single-body">
                    <div>计划完成时间：[[${#dates.format(consumeTask.planCompleteTime,'yyyy-MM-dd')}]]</div>
                    <div>开始时间：[[${#dates.format(consumeTask.startTime,'yyyy-MM-dd')}]]</div>
                    <div>完成时间：[[${#dates.format(consumeTask.endTime,'yyyy-MM-dd')}]]</div>
                    <div>总数量(件)：[[${consumeTask.num}]]<span style="margin-left: 10px">总重量(吨)：</span>[[${#numbers.formatDecimal(consumeTask.weight,1,2)}]]</div>
                    <div>状态：[[${consumeTask.status == 0 ? '不需要' : (consumeTask.status == 1 ? '未开始' : (consumeTask.status == 2 ? '执行中' : '已完成'))}]]</div>
                    <div>备注：[[${consumeTask.remark}]]</div>
                </div>
                <div class="box-footer single-foot">
                    <button th:if="${project.status == 2 && consumeTask.status != 0}"
                            style="margin-right: 5px" class="btn btn-warning btn-xs pull-right"
                            shiro:hasPermission="single:edit:consume"
                            th:onclick="|openEditTaskModal(${consumeTask.id},'consume')|">
                        编辑
                    </button>
                    <button style="margin-right: 5px" class="btn btn-success btn-xs pull-right"
                            shiro:hasAnyPermissions="single:upload:consume,single:download:consume"
                            th:onclick="|openFileModal(${consumeTask.id},'consume')|">
                        文件
                    </button>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <!--互动专区-->
        <div class="col-md-3">
            <div class="box box-info box-solid">
                <div class="box-header with-border">
                    <h3 class="box-title">互动专区</h3>
                </div>
                <div class="box-body single-body">
                    <div th:each="message,stat:${messages}" th:if="${stat.index < 6}">
                        <span th:text="${message.sendUserName == '管理员' ? '系统通知' : message.sendUserName}"></span>：
                        <span th:text="${#strings.abbreviate(message.content,15)}"></span>
                    </div>
                </div>
                <div class="box-footer single-foot">
                    <button style="margin-right: 5px" class="btn btn-info btn-xs pull-right" onclick="openMessageModal()">查看</button>
                </div>
            </div>
        </div>
        <!--喷涂-->
        <div class="col-md-3">
            <div class="box box-solid" th:if="${sprayTask != null}"
                 th:classappend="${sprayTask.status == 0 ? 'box-danger' : (sprayTask.status == 1 ? 'box-default' : (sprayTask.status == 2 ? 'box-warning' : 'box-success'))}">
                <div class="box-header box- with-border">
                    <h3 class="box-title" th:text="${sprayTask.alias}">平库</h3>
                    <small class="pull-right" th:if="${sprayTask.docNum != null}" th:text="|已上传：${sprayTask.docNum}|"></small>
                </div>
                <div class="box-body single-body">
                    <div>计划完成时间：[[${#dates.format(sprayTask.planCompleteTime,'yyyy-MM-dd')}]]</div>
                    <div>开始时间：[[${#dates.format(sprayTask.startTime,'yyyy-MM-dd')}]]</div>
                    <div>完成时间：[[${#dates.format(sprayTask.endTime,'yyyy-MM-dd')}]]</div>
                    <div>总数量(件)：[[${sprayTask.num}]]<span style="margin-left: 10px">总重量(吨)：</span>[[${#numbers.formatDecimal(sprayTask.weight,1,2)}]]</div>
                    <div>状态：[[${sprayTask.status == 0 ? '不需要' : (sprayTask.status == 1 ? '未开始' : (sprayTask.status == 2 ? '执行中' : '已完成'))}]]</div>
                    <div>备注：[[${sprayTask.remark}]]</div>
                </div>
                <div class="box-footer single-foot">
                    <button th:if="${project.status == 2 && sprayTask.status != 0}"
                            style="margin-right: 5px" class="btn btn-warning btn-xs pull-right"
                            shiro:hasPermission="single:edit:spray"
                            th:onclick="|openEditTaskModal(${sprayTask.id},'spray')|">
                        编辑
                    </button>
                    <button style="margin-right: 5px" class="btn btn-success btn-xs pull-right"
                            shiro:hasAnyPermissions="single:upload:spray,single:download:spray"
                            th:onclick="|openFileModal(${sprayTask.id},'spray')|">
                    文件
                    </button>
                </div>
            </div>
        </div>
        <!--包装-->
        <div class="col-md-3">
            <div class="box box-solid" th:if="${packTask != null}"
                 th:classappend="${packTask.status == 0 ? 'box-danger' : (packTask.status == 1 ? 'box-default' : (packTask.status == 2 ? 'box-warning' : 'box-success'))}">
                <div class="box-header box- with-border">
                    <h3 class="box-title" th:text="${packTask.alias}">平库</h3>
                    <small class="pull-right" th:if="${packTask.docNum != null}"
                           th:text="|已上传：${packTask.docNum}|"></small>
                </div>
                <div class="box-body single-body">
                    <div>计划完成时间：[[${#dates.format(packTask.planCompleteTime,'yyyy-MM-dd')}]]</div>
                    <div>开始时间：[[${#dates.format(packTask.startTime,'yyyy-MM-dd')}]]</div>
                    <div>完成时间：[[${#dates.format(packTask.endTime,'yyyy-MM-dd')}]]</div>
                    <div>总数量(件)：[[${packTask.num}]]<span style="margin-left: 10px">总重量(吨)：</span>[[${#numbers.formatDecimal(packTask.weight,1,2)}]]</div>
                    <div>铝支撑数量(件)：[[${packTask.supportNum}]]<span style="margin-left: 10px">铝支撑重量(吨)：</span>[[${#numbers.formatDecimal(packTask.supportWeight,1,2)}]]</div>
                    <div>状态：[[${packTask.status == 0 ? '不需要' : (packTask.status == 1 ? '未开始' : (packTask.status == 2 ? '执行中' : '已完成'))}]] [[${packTask.reason}]]</div>
                    <div>备注：[[${packTask.remark}]]</div>
                    <div>
                        <span th:if="${packTask.mainStatus == 1}" class="badge label-default">主体</span>
                        <span th:if="${packTask.mainStatus == 2}" class="badge label-warning">主体</span>
                        <span th:if="${packTask.mainStatus == 3}" class="badge label-success">主体</span>
                        <span th:if="${packTask.ironStatus == 1}" style="margin-left: 10px" class="badge label-default">铁件</span>
                        <span th:if="${packTask.ironStatus == 2}" style="margin-left: 10px" class="badge label-warning">铁件</span>
                        <span th:if="${packTask.ironStatus == 3}" style="margin-left: 10px" class="badge label-success">铁件</span>
                        <span th:if="${packTask.backStatus == 1}" style="margin-left: 10px" class="badge label-default">背楞</span>
                        <span th:if="${packTask.backStatus == 2}" style="margin-left: 10px" class="badge label-warning">背楞</span>
                        <span th:if="${packTask.backStatus == 3}" style="margin-left: 10px" class="badge label-success">背楞</span>
                        <span th:if="${packTask.supportStatus == 1}" style="margin-left: 10px" class="badge label-default">支撑</span>
                        <span th:if="${packTask.supportStatus == 2}" style="margin-left: 10px" class="badge label-warning">支撑</span>
                        <span th:if="${packTask.supportStatus == 3}" style="margin-left: 10px" class="badge label-success">支撑</span>
                    </div>
                </div>
                <div class="box-footer single-foot">
                    <button th:if="${packTask.status != 0}"
                            style="margin-right: 5px" class="btn btn-warning btn-xs pull-right"
                            shiro:hasPermission="single:edit:pack"
                            th:onclick="|openEditTaskModal(${packTask.id},'pack')|">
                        编辑
                    </button>
                    <button style="margin-right: 5px" class="btn btn-success btn-xs pull-right"
                            shiro:hasAnyPermissions="single:upload:pack,single:download:pack"
                            th:onclick="|openFileModal(${packTask.id},'pack')|">
                        文件
                    </button>
                </div>
            </div>
        </div>
        <!--仓储-->
        <div class="col-md-3">
            <div class="box box-solid" th:if="${storeTask != null}"
                 th:classappend="${storeTask.status == 0 ? 'box-danger' : (storeTask.status == 1 ? 'box-default' : (storeTask.status == 2 ? 'box-warning' : 'box-success'))}">
                <div class="box-header box- with-border">
                    <h3 class="box-title" th:text="${storeTask.alias}">平库</h3>
                    <small class="pull-right" th:if="${storeTask.docNum != null}"
                           th:text="|已上传：${storeTask.docNum}|"></small>
                </div>
                <div class="box-body single-body">
                    <div>开始时间：[[${#dates.format(storeTask.startTime,'yyyy-MM-dd')}]]</div>
                    <div>完成时间：[[${#dates.format(storeTask.endTime,'yyyy-MM-dd')}]]</div>
                    <div>首次发货时间：[[${#dates.format(storeTask.firstShipTime,'yyyy-MM-dd')}]]</div>
                    <div>最后发货时间：[[${#dates.format(storeTask.lastShipTime,'yyyy-MM-dd')}]]</div>
                    <div>备注：[[${storeTask.remark}]]</div>
                </div>
                <div class="box-footer single-foot">
                    <!--<button th:if="${project.status == 2 && storeTask.status != 0}"-->
                    <button th:if="${storeTask.status != 0}"
                            style="margin-right: 5px" class="btn btn-warning btn-xs pull-right"
                            shiro:hasPermission="single:edit:store"
                            th:onclick="|openEditTaskModal(${storeTask.id},'store')|">
                        编辑
                    </button>
                    <button style="margin-right: 5px" class="btn btn-success btn-xs pull-right"
                            shiro:hasAnyPermissions="single:upload:store,single:download:store"
                            th:onclick="|openFileModal(${storeTask.id},'store')|">
                        文件
                    </button>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    var statusName = ["", "未开始", "执行中", "已完成"];

    /** 处理编辑模态框状态 */
    function handleStatus(status) {
        $(".status-span").text(statusName[status]);
        switch (status) {
            case 1:
                $(".btn-start").show();
                $(".btn-end,.btn-cancel").hide();
                break;
            case 2:
                $(".btn-end,.btn-cancel").show();
                $(".btn-start").hide();
                break;
            case 3:
                $(".btn-cancel").show();
                $(".btn-start,.btn-end").hide();
                break;
            default:
                break;
        }
    }

    /** 打开任务模态框 */
    function openEditTaskModal(id, name) {
        js.post({
            url: ctx + "board/single/task/id",
            data: {
                id: id
            },
            success: function (result) {
                $("#taskForm-" + name).fillData(result);
                js.updateDatePicker();
                handleStatus(result.status);
                js.modal.open("modal-task-" + name);
                if (result.taskTempId === 6) {
                    if (result.mainStatus) {
                        $("#div-main").show();
                    } else {
                        $("#div-main").hide();
                    }
                    if (result.backStatus) {
                        $("#div-back").show();
                    } else {
                        $("#div-back").hide();
                    }
                    if (result.ironStatus) {
                        $("#div-iron").show();
                    } else {
                        $("#div-iron").hide();
                    }
                    if (result.supportStatus) {
                        $("#div-support").show();
                    } else {
                        $("#div-support").hide();
                    }
                }
                js.modal.closeLoading();
            }
        })
    }

    /** 打开文件模态框 */
    function openFileModal(id, name) {
        js.post({
            url: ctx + "board/single/task/file",
            data: {
                id: id
            },
            success: function (result) {
                $("#fileForm-" + name).find("input[name='taskId']").val(id);
                var html = [];
                $.each(result, function (i, v) {
                    html.push(`<div class="row">
                            <input style="margin-left: 20px" type="checkbox" name="id" value="${v.id}">
                            <label style="margin-left: 10px">${v.name}</label>
                        </div>`)
                });
                $(".file-div").empty().html(html.join(''));
                js.modal.open("modal-file-" + name);
                js.modal.closeLoading();
            }
        })
    }

    /** 配置重点项目 */
    function updateFocus(id, focus) {
        js.post({
            url: ctx + "board/single/focus",
            data: {
                id: id,
                focus: focus
            },
            success: function (result) {
                if (result.type === web_status.SUCCESS) {
                    js.modal.success(result.msg);
                    if (focus === 1) {
                        $("#focus-btn").hide();
                        $("#unFocus-btn").show();
                    } else {
                        $("#focus-btn").show();
                        $("#unFocus-btn").hide();
                    }
                } else {
                    js.modal.warning(result.msg);
                }
                js.modal.closeLoading();
            }
        });
    }

    /** 显示互动专区模态框 */
    function openMessageModal() {
        js.modal.open("modal-message");
    }

    /** 编辑任务 */
    function editTask(formDate) {
        js.submit({
            url: ctx + "board/single/task/edit",
            data: formDate,
            success: function (result) {
                if (result.type === web_status.SUCCESS) {
                    location.reload();
                } else {
                    js.modal.warning(result.msg);
                }
                js.modal.closeLoading();
            }
        });
    }

    $(function () {

        /** 打开互动消息模态框之后，滚动到最后一条 */
        js.modal.openEvent("modal-message", function () {
            var messageBox = $("#message-box")[0];
            messageBox.scrollTop = messageBox.scrollHeight;
        });

        /** 获取用户列表载入自动完成数据 @提到我功能 */
        js.get({
            url: ctx + "board/single/users",
            success: function (result) {
                js.modal.closeLoading();
                $("#message").typeahead({
                    items: 10,
                    source: result,
                    matcher: function (item) {
                        return ~item.name.indexOf(this.query.substring(this.query.lastIndexOf("@") + 1));
                    },
                    updater: function (item) {
                        return this.query.substring(0, this.query.lastIndexOf("@") + 1) + item.name + " ";
                    },
                    afterSelect: function () {
                        window.document.getElementById("message").focus();
                    }
                });
            }
        });

        /** 发送消息 */
        $("#btn-send").click(function () {
            if ($("#message").val() === '') {
                js.modal.warning("留点内容吧");
                return;
            }
            js.submit({
                url: ctx + "board/single/sendMessage",
                data: new FormData($("#messageForm")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        var img = ctx + "img/avatar.png";
                        if (sessionUser.img != null) {
                            img = sessionUser.img;
                        }
                        var html = [];
                        html.push('<div class="direct-chat-msg right">');
                        html.push('<div class="direct-chat-info clearfix">');
                        html.push('<span class="direct-chat-name pull-right">');
                        html.push(sessionUser.name === '管理员' ? '系统通知' : sessionUser.name);
                        html.push('</span>');
                        html.push('<span class="direct-chat-timestamp pull-left">');
                        html.push(new Date().format("yyyy-MM-dd hh:mm:ss"));
                        html.push('</span>');
                        html.push('</div>');
                        html.push('<img class="direct-chat-img" alt="Message User Image" src="' + img + '">');
                        html.push('<div class="direct-chat-text">');
                        html.push($("#message").val());
                        html.push('</div>');
                        html.push('</div>');
                        $("#message-box").append(html.join(''));
                        $("#message-box")[0].scrollTop = $("#message-box")[0].scrollHeight;
                        $("#message").val('');
                    } else {
                        js.modal.warning(result.msg);
                    }
                    js.modal.closeLoading();
                }
            });
        });

        /** 开始任务按钮 */
        $(".btn-start").click(function () {
            var formData = new FormData($(this).parents(".modal").find("form")[0]);
            formData.append("status", 2);
            editTask(formData);
        });

        /** 完成任务按钮 */
        $(".btn-end").click(function () {
            var formData = new FormData($(this).parents(".modal").find("form")[0]);
            formData.append("status", 3);
            var num = $(this).parents("form").find("input[name='num']").val();
            var completeNum = $(this).parents("form").find("input[name='completeNum']").val();
            var weight = $(this).parents("form").find("input[name='weight']").val();
            if (weight == '') {
                weight = 0;
            }
            var completeWeight = $(this).parents("form").find("input[name='completeWeight']").val();
            if (typeof completeNum === 'undefined' || typeof completeWeight === 'undefined') {
                editTask(formData);
            } else if (!completeNum || num != completeNum) {
                js.modal.prompt("完成量与实际量不一致，请输入原因", function (str) {
                    if (str) {
                        formData.append("reason", str);
                        editTask(formData);
                    }
                });
            } else {
                editTask(formData);
            }
        });

        /** 撤消任务按钮 */
        $(".btn-cancel").click(function () {
            js.post({
                url: ctx + "board/single/task/cancel",
                data: {
                    id: $(this).parents("form").find("input[name='id']").val(),
                },
                success: function (result) {
                    location.reload();
                }
            })
        });

        /** 保存任务按钮 */
        $(".btn-submit").click(function () {
            var formData = new FormData($(this).parents(".modal").find("form")[0]);
            editTask(formData);
        });

        /** 文件上传按钮 */
        $(".btn-file-upload").click(function () {
            var $this = $(this);
            if (!$this.parents(".modal").find("input[name='file']").get(0).files[0]) {
                js.modal.warning("请至少选择一个文件");
                return false;
            }
            js.submit({
                url: ctx + "board/single/file/upload",
                data: new FormData($this.parents(".modal").find("form")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        location.reload();
                    } else {
                        js.modal.warning(result.msg);
                    }
                    js.modal.closeLoading();
                }
            });
        });

        /** 文件下载按钮 */
        $(".btn-file-download").click(function () {
            var $this = $(this);
            if ($this.parents(".modal").find("input:checkbox:checked").length == 0) {
                js.modal.warning("请至少选择一个文件");
                return false;
            } else {
                var args = [];
                $this.parents(".modal").find("input:checkbox:checked").each(function () {
                    args.push("&id=" + $(this).val());
                });
                window.location.href = ctx + "board/single/file/download?time" + new Date().getTime() + args.join('');
            }
        });

        /** 文件删除按钮 */
        $(".btn-file-del").click(function () {
            var $this = $(this);
            if ($this.parents(".modal").find("input:checkbox:checked").length == 0) {
                js.modal.warning("请至少选择一个文件");
                return false;
            }
            js.submit({
                url: ctx + "board/single/file/del",
                data: new FormData($this.parents(".modal").find("form")[0]),
                success: function (result) {
                    if (result.type === web_status.SUCCESS) {
                        location.reload();
                    } else {
                        js.modal.warning(result.msg);
                    }
                    js.modal.closeLoading();
                }
            });
        });

    });
</script>
</body>
</html>
